package com.killer.goods.controller;


import com.killer.common.entity.Result;
import com.killer.db.controller.BaseController;
import com.killer.goods.entity.Spec;
import com.killer.goods.service.ISpecService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 规格表 前端控制器
 * </p>
 *
 * @author killer
 * @since 2021-08-04
 */
@RestController
@RequestMapping("/spec")
public class SpecController extends BaseController<ISpecService, Spec> {

    @GetMapping("/findByCategoryName")
    public Result<List<Spec>> findByCategoryName(@RequestParam("categoryName") String categoryName) {
        List<Spec> specs = baseService.findByCategoryName(categoryName);
        return Result.success(specs);
    }

}
